﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 登入窗口
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            //点击按钮时执行的事件
            if(user_box.Text == "admin" && password_box.Text == "123456")
            {
                //执行登录
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show("账号或密码错误");
                this.DialogResult = DialogResult.No;
            }
        }
    }
}
